"""
    sqlalchemy 模型，用于数据库操作
"""
from sqlalchemy import Column, Integer, String, TIMESTAMP
from sqlalchemy import Float
from sqlalchemy.orm import declarative_base

Base = declarative_base()

class Rate(Base):
    """
        费率对象
    """
    __tablename__ = 'tb_rate'
    rate_id = Column(Integer, primary_key=True)
    fund_code = Column(Integer, comment="基金代码")
    fund_name = Column(String(50), comment="基金名")
    discount = Column(String(10), comment="费率")
    taxRate = Column(String(10), comment="原费率")


class Nav(Base):
    """
        净值对象
    """
    __tablename__ = 'tb_nav'
    nav_id = Column(Integer, primary_key=True)
    fund_code = Column(Integer, comment="基金代码")
    fund_name = Column(String(50), comment="基金名")
    date = Column(TIMESTAMP, comment="日期")
    per_nav = Column(String(10), comment="单位净值")
    per_accum_nav = Column(String(10), comment="累计净值")
